home *** CD-ROM | disk | FTP | other *** search
- /* The <signal.h> header defines all the ANSI and POSIX signals.
- * MINIX supports all the signals required by POSIX. They are defined below.
- * Some additional signals are also supported.
- */
-
- #ifndef _SIGNAL_H
- #define _SIGNAL_H
-
- #define _NSIG 16 /* number of signals used */
- #define NR_SIGS _NSIG
-
- #define SIGHUP 1 /* hangup */
- #define SIGINT 2 /* interrupt (DEL) */
- #define SIGQUIT 3 /* quit (ASCII FS) */
- #define SIGILL 4 /* illegal instruction */
- #define SIGTRAP 5 /* trace trap (not reset when caught) */
- #define SIGABRT 6 /* IOT instruction */
- #define SIGEMT 7 /* EMT instruction */
- #define SIGFPE 8 /* floating point exception */
- #define SIGKILL 9 /* kill (cannot be caught or ignored) */
- #define SIGBUS 10 /* bus error */
- #define SIGSEGV 11 /* segmentation violation */
- #define SIGSYS 12 /* bad argument to system call */
- #define SIGPIPE 13 /* write on a pipe with no one to read it */
- #define SIGALRM 14 /* alarm clock */
- #define SIGTERM 15 /* software termination signal from kill */
-
- #define SIGSTKFLT 16 /* used by kernel to indicate stack fault */
- #define STACK_FAULT 16 /* used by kernel to signal stack fault */
-
- /* POSIX requires the following signals to be defined, even if they are
- * not supported. Here are the definitions, but they are not supported.
- */
- #define SIGCHLD 17 /* child process terminated or stopped */
- #define SIGCONT 18 /* continue if stopped */
- #define SIGSTOP 19 /* stop signal */
- #define SIGTSTP 20 /* interactive stop signal */
- #define SIGTTIN 21 /* background process wants to read */
- #define SIGTTOU 22 /* background process wants to write */
-
- #ifdef _POSIX_SOURCE
- #define SA_NOCLDSTOP 1 /* signal parent if child stops */
-
- /* Here are types that are closely associated with signal handling. */
- typedef int sig_atomic_t;
- typedef unsigned short sigset_t;
-
- #endif /* _POSIX_SOURCE */
-
- /* POSIX requires these values for use on system calls involving signals. */
- #define SIG_BLOCK 0 /* for blocking signals */
- #define SIG_UNBLOCK 1 /* for unblocking signals */
- #define SIG_SETMASK 2 /* for setting the signal mask */
-
- /* Macros used as function pointers and one awful prototype. */
- #if _ANSI
- #define SIG_DFL ((void (*)(int))0) /* default signal handling */
- #define SIG_IGN ((void (*)(int))1) /* ignore signal */
- #define SIG_ERR ((void (*)(int))-1)
-
- void (*signal(int sig, void (*func)(int)))(int);
-
- #ifdef _POSIX_SOURCE /* otherwise sigset_t is not defined */
- struct sigaction {
- void (*sa_handler)(int); /* SIG_DFL, SIG_IGN, or pointer to function */
- sigset_t sa_mask; /* signals to be blocked during handler */
- int sa_flags; /* special flags */
- };
- #endif
- #else
- #define SIG_DFL ((void (*)())0) /* default signal handling */
- #define SIG_IGN ((void (*)())1) /* ignore signal */
- #define SIG_ERR ((void (*)())-1)
-
- void (*signal()) ();
-
- #ifdef _POSIX_SOURCE /* otherwise sigset_t is not defined */
- struct sigaction {
- void (*sa_handler)(); /* SIG_DFL, SIG_IGN, or pointer to function */
- sigset_t sa_mask; /* signals to be blocked during handler */
- int sa_flags; /* special flags */
- };
- #endif
- #endif
-
- /* Function Prototypes. */
- #ifndef _ANSI_H
- #include <ansi.h>
- #endif
-
- _PROTOTYPE( int raise, (int __sig) );
-
- #ifdef _POSIX_SOURCE
- _PROTOTYPE( int kill, (int __pid, int __sig) );
- _PROTOTYPE( int sigaddset, (sigset_t *__set) );
- _PROTOTYPE( int sigdelset, (sigset_t *__set) );
- _PROTOTYPE( int sigemptyset, (sigset_t *__set) );
- _PROTOTYPE( int sigfillset, (sigset_t *__set) );
- _PROTOTYPE( int sigismember, (sigset_t *__set, int __signo) );
- _PROTOTYPE( int sigpending, (sigset_t *set) );
- _PROTOTYPE( int sigprocmask, (int __how, sigset_t *__set, sigset_t *__oset) );
- _PROTOTYPE( int sigsuspend, (sigset_t *__sigmask) );
- _PROTOTYPE( int sigaction, \
- (int __sig, struct sigaction *__a, struct sigaction *__oact) );
- #endif
-
- #endif /* _SIGNAL_H */
-